#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <limits.h>
#define OJ_TEST 0
#define LOCAL_TEST 0

#define M 3001

static int max(int a, int b){ return a>b?a:b; }
static int min(int a, int b) { return a<b?a:b; }

static int occupy[M];
static void solve(void){
	int n, i, diff, flag;
	int a, b;
	while(~scanf("%d", &n)){
		flag=1;
		memset(occupy, 0, sizeof(occupy));
		scanf("%d", &a);
		for(i=1; i<n; ++i){
			scanf("%d", &b);
			if(!flag) continue;
			diff= abs(b-a);
			a = b;
			if(diff<1 || diff>=n){
				flag = 0;
			}else{
				if(occupy[diff]){
					flag=0;
				}else{
					occupy[diff] = 1;
				}
			}
		}
		if(flag){
			puts("Jolly");
		}else{
			puts("Not jolly");
		}
	}

}
#if OJ_TEST
	int main(int ac, char *av[]){
		solve();
		return 0;
	}
#elif  LOCAL_TEST
	void run(void){
		solve();
	}

#else

#endif
